import java.util.Scanner;

public class TestDemo {
// /    public static int sum1(int n){
//         if(n == 1)
//             return 1;
//         else
//             return n + sum(n - 1);
//     }

    public static int sum(int n){
        if(n < 10)
            return n;
        else
            return (n % 10) + sum(n / 10);
    }
    public static void main(String[] args) {
        System.out.println(sum(1234567));

    }
    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num1 = sc.nextInt();
        int num2 = sc.nextInt();
        while (num1 != 0){
            int tmp = num1;
            num1 = num2 % num1;
            num2 = tmp;
        }
        System.out.println(num2);

    }
}
